package com.gin.supermarket_inventory_system.commodity.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.gin.database.base.BasePo;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Comment;

/**
 * 商品信息
 * @since : 2023/10/8 17:54
 * @author : ginstone
 * @version : v1.0.0
 **/
@Getter
@Setter
@TableName(value = CommodityPo.TABLE_NAME, autoResultMap = true)
@Entity(name = CommodityPo.TABLE_NAME)
@NoArgsConstructor
@Table(uniqueConstraints = {
        @UniqueConstraint(columnNames = {"name", "typeId", "producerId"})
})
public class CommodityPo extends BasePo {
    protected static final String TABLE_NAME = "tb_commodity_entity_info";

    @Column(nullable = false)
    @Comment("名称(系列名称)")
    String name;

    @Column(nullable = false)
    @Comment("商品类型ID")
    Long typeId;

    @Column(nullable = false)
    @Comment("商品生产商ID")
    Long producerId;

}